Primitive Class Vec2

Represents a 2D vector.

Members

x (int) x coordinate
y (int) y coordinate

Functions

Vec2:ToLength(length) Modify this vector so that it becomes close to the requested length.
Vec2(X, Y)
__tostring(Vec2) Metafunction; use tostring(myVector)


Members

x
(int) x coordinate
y
(int) y coordinate

Functions

Vec2:ToLength(length)
Modify this vector so that it becomes close to the requested length.

Note that since the engine uses integers instead of floating-point numbers, this will be less accurate at smaller lengths.

Parameters:

  • length float the new length to set the vector to.
Vec2(X, Y)

Parameters:

  • X int x coordinate
  • Y int y coordinate

Returns:

    Vec2 A Vec2 object.
__tostring(Vec2)
Metafunction; use tostring(myVector)

Parameters:

  • Vec2 Vec2 this Vec2

Returns:

    string A string showing the x, y, and z values of the Vec2
generated by TEN-LDoc (a fork of LDoc 1.4.6) Last updated 2023-06-03 11:42:57